/*
 * @Author       : Bing Chen chenbing@iocharger.com
 * @Date         : 2024-05-20 22:39:53
 * @LastEditors  : Bing Chen chenbing@iocharger.com
 * @LastEditTime : 2025-03-15 12:28:10
 * @FilePath     : \openchaoji-corelib\evcc\app\OpenChaoJi_evcc_main.c
 * @Description  : evcc的主入口
 *
 * Copyright (c) 2025 OpenChaoJi
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the icense for the specific language governing permissions and
 * limitations under the License.
 *
 */

#include "OpenChaoJi_evcc.h"

#ifndef DEMO_APP_FOR_GCC

#else

/* X86 GCC 测试程序 */

#include <unistd.h>


extern void evcc_app_init();
extern void evcc_app_service();
extern void evcc_app_term();


int main()
{
    evcc_app_init();

    // 通过定时触发service服务来驱动整个系统的活动
    // 厂家可以通过线程,中断,死循环等各种方式实现, 只需要保证频度足够
    // 但是本方法需要保证不能阻塞
    while (1)
    {
        evcc_app_service();

        usleep(2000);
    }

    evcc_app_term();

    return 0;
}

#endif


